﻿
namespace my_webapi_demo.HuaskyAuth;

public static class HuaskyAuth
{
    public static void AddHuaskyAuth(this IServiceCollection services)
    {
        services.AddAuthentication(options =>
        {
            options.AddScheme<AuthHandler>(AuthHandler.SchemeName, "default scheme");
            options.DefaultAuthenticateScheme = AuthHandler.SchemeName;
            options.DefaultChallengeScheme = AuthHandler.SchemeName;
        });
    }

    public static void UseHuaskyAuth(this WebApplication app)
    {
        app.UseAuthentication();
        app.UseAuthorization();
    }
}
